/**
 * 组织机构service
 * @author李艳
 */
import httpUtils from "../../../commons/utils/FeatchUtils";
import { basicUrl} from "../../../configs/DefaultConfig"

/**
 * 获取所有组织机构
 * @param params
 * @returns {*}
 */
export const getOrganizationTree = (params={}) => {
    return httpUtils.get(basicUrl + "/organization/findOrgTree", params)
};
/**
 * 获取所有组织机构 不包括冻结
 * @param params
 * @returns {*}
 */
export async function listAllTree(params={}){
    return httpUtils.get(basicUrl+"/organization/findOrgTreeWithoutFrozen",params);
}

export const save = (params) => {
    return httpUtils.postJson(basicUrl + "/organization/save", JSON.stringify(params))
}

/**
 * 移动节点
 * param nodeId         当前节点id标识
 * param targetParentId 目标父节点id标识
 */
export async function move(params={}){
    return httpUtils.post(basicUrl+"/organization/move",params);
}
/**
 * 删除一个节点
 *
 * param id
 * return 操作结果
 */
export async function deleteNode(params=""){
    return httpUtils.delete(basicUrl+"/organization/delete",params);
}
